/*
 *
 * This file is part of the open-source SeetaFace engine, which includes three modules:
 * SeetaFace Detection, SeetaFace Alignment, and SeetaFace Identification.
 *
 * This file is an example of how to use SeetaFace engine for face alignment, the
 * face alignment method described in the following paper:
 *
 *
 *   Coarse-to-Fine Auto-Encoder Networks (CFAN) for Real-Time Face Alignment, 
 *   Jie Zhang, Shiguang Shan, Meina Kan, Xilin Chen. In Proceeding of the
 *   European Conference on Computer Vision (ECCV), 2014
 *
 *
 * Copyright (C) 2016, Visual Information Processing and Learning (VIPL) group,
 * Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China.
 *
 * The codes are mainly developed by Jie Zhang (a Ph.D supervised by Prof. Shiguang Shan)
 *
 * As an open-source face recognition engine: you can redistribute SeetaFace source codes
 * and/or modify it under the terms of the BSD 2-Clause License.
 *
 * You should have received a copy of the BSD 2-Clause License along with the software.
 * If not, see < https://opensource.org/licenses/BSD-2-Clause>.
 *
 * Contact Info: you can send an email to SeetaFace@vipl.ict.ac.cn for any problems.
 *
 * Note: the above information must be kept whenever or wherever the codes are used.
 *
 */

/*
 * Recreated for Deep Learning study, by
 *
 * author: BDG
 * date: Thu 06 Oct 2016 11:00:38 
 * */

#pragma once

#include <cstdint>
#include <fstream>
#include <string>
#include <cstdlib>
#include <unistd.h>

#include "cv.h"
#include "highgui.h"

#include "seeta_face_detection.h"
#include "seeta_face_alignment.h"

//#ifdef _WIN32
//std::string DATA_DIR = "../../data/";
//std::string MODEL_DIR = "../../model/";
//#else
////#error "To here" // BDG, Wed 28 Sep 2016 20:03:03 
//std::string DATA_DIR = "./data/";
//std::string MODEL_DIR = "./model/";
//#endif

class SeetaAlignment
{
    public:
        SeetaAlignment(
                const std::string model_path_face_detection="model/seeta_fd_frontal_v1.0.bin",
                const std::string model_path_face_alignment="model/seeta_fa_v1.1.bin");
        int alignTarget(const std::string &in_img, std::string &res_img);
        int alignTarget(const IplImage *in_img, std::string &res_img);

        seeta::FaceDetection *detector;
        seeta::FaceAlignment *point_detector;

    private:
        std::string model_path_fd;
        std::string model_path_fa;
};

